package Text27;

import java.util.*;

public class Main {
    static int N = 100010;
    static long[] a = new long[N];
    static long[] b = new long[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextInt();
            b[i] = a[i] - a[i - 1];
        }
        long p = 0, q = 0;
        for (int i = 2; i <= n; i++) {
            if (b[i] >= 0) {
                p += b[i];
            } else {
                q -= b[i];
            }
        }
        System.out.println(Math.max(p, q));
        System.out.println(Math.abs(p - q) + 1);
    }
}
